# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Manolis Tzanidakis

pkgname=perl-net-ssleay
_cpanname=Net-SSLeay
pkgver=1.90
pkgrel=2
pkgdesc='Perl extension for using OpenSSL'
url='https://search.cpan.org/dist/Net-SSLeay/'
arch=('x86_64')
license=('custom:BSD')
depends=('openssl')
makedepends=('chrpath')
replaces=('net-ssleay')
provides=('net-ssleay')
options=('!emptydirs')
source=(https://cpan.metacpan.org/authors/id/C/CH/CHRISN/${_cpanname}-${pkgver}.tar.gz)
sha512sums=('8a5f251b5ef1d8c2d619d984594a7a22ddeed2e5e726fe683a45f299d7878f4ca8ffab00480ebf5ef7a94ae1fcf6be05dfdaa68b8bfe2ad68443150765adb891')
b2sums=('2510fa886db8b7c5f185aa1145ae1b50b7c4101a9bd80e17c8c1d77718765f288c9180464d831775c35aa94b5a6f6c8f717ecaeb4974f7280829b63f10567f22')

build() {
  cd ${_cpanname}-${pkgver}
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd ${_cpanname}-${pkgver}
  make test
}

package() {
  cd ${_cpanname}-${pkgver}

  make install DESTDIR="${pkgdir}"
  install -Dm 644 README -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"

  # strip rpath
  find "${pkgdir}" -name '*.so' -exec chrpath -d '{}' \;
}

# vim: ts=2 sw=2 et:
